GRAPH_SIZE = 500;
GRAPH_DENSITY=0.5;
ITER = 1000;
TEMPERATURE=10000;


res = zeros(10, 11);
for i=1:10
    % Graf:
    G = generateGraph(GRAPH_SIZE, GRAPH_DENSITY);
    % Pokolorowanie grafu:
    K = randomColoring(size(G, 1));
    it=1;
    for j=0.5:0.05:1.0
        [cst coloring] = simAnnP(G, K, TEMPERATURE, j, ITER);
        res(i, it) = checkColoring(G, coloring);
        it = it + 1;
    end
end
maxs = max(res);
meds = median(res);


plot(0.5:0.05:1.0, maxs, 'Color', 'blue', 'LineWidth', 1);
hold on;
plot(0.5:0.05:1.0, meds, 'Color', 'red', 'LineWidth', 2);
xlabel('Wspolczynnik');
ylabel('Liczba konfliktow');
legend('Maximum', 'Mediana',...
    'Location','NorthEastOutside');

print('-dpng','images/konflikty_wspolczynnik');
hold off;